<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<%@ taglib prefix="his_fns" uri="/WEB-INF/tlds/his_fns.tld" %>
<script type="text/javascript">
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
            btsubmit();
        	return false;
        }
        function btsubmit() {
            var form=$("#searchForm");
            form.attr("onsubmit","return loadDivForm('mainCenterDiv','searchForm','${ctx}/csm/expStock/query');")
            <%--if($("#batch").is(':checked')){--%>
                <%--$("#batchNo").hide();--%>
                <%--$("#expireDate").hide();--%>
                <%--$("#batchNo1").hide();--%>
                <%--$("#expireDate1").hide();--%>
                <%--form.attr("onsubmit","return loadDivForm('mainCenterDiv','searchForm','${ctx}/csm/expStock/query');")--%>
            <%--}else{--%>
                <%--form.attr("onsubmit","return loadDivForm('mainCenterDiv','searchForm','${ctx}/csm/expStock/queryBat');")--%>
            <%--}--%>
            form.submit();
        }
</script>
    <div class="content-wrap">
        <div class="wrapper" style="bottom: 50px;">
            <ul class="nav nav-tabs">
                <li class="active">
                    <a href="#"   onclick="loadDiv('mainCenterDiv','${ctx}/csm/expStock/expStockQuery')">库存量列表</a>
                </li>
            </ul>
            <section class="panel panel-default">
                <div class="panel-body">
                    <div class="table-responsive no-border">
                        <div class="datatable-top">
                            <div class="pull-left">
                            	<form:form id="searchForm" modelAttribute="expStock"  onsubmit="" method="post" class="form-inline">
                                    <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
                                    <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
                                    <label >消耗品类别:</label>
                                    <sys:treeselect selectedParent="true" id="expType" name="expType" value="${expStock.expType}"
                                                    update="${not empty expType}" labelName="expType1"
                                                    labelValue="${expStock.expNameDict.expClassDict.className}"
                                                    title="消耗品类别"
                                                    url="/csm/expClassDict/treeData" extId="${expStock.id}" cssClass="form-control"/>
                                    <label>消耗品名称：</label><form:input path="expName" htmlEscape="false" maxlength="50" class="form-control" />
                                    <%--<label>合并批号：</label><form:checkbox path="batch" id="batch" htmlEscape="false"></form:checkbox>--%>
                                    <input id="btnSubmit" class="btn btn-primary" type="button" value="查询" onclick="btsubmit()"/>
                                </form:form>
                            </div>
                        </div>
                        <table id="contentTable" class="table table-bordered table-striped mg-t datatable">
                            <thead>
                                <tr>
                                    <th>品名</th>
                                    <th>型号</th>
                                    <th>规格</th>
                                    <th>单位</th>
                                    <th>厂家</th>
                                    <th id="batchNo">批号</th>
                                    <th id="expireDate">有效期</th>
                                    <td>灭菌方式</td>
                                    <td>灭菌批号</td>
                                    <td>灭菌日期</td>
                                    <th>库存量</th>
                                </tr>
                            </thead>
                            <tbody>
                            <c:forEach items="${page.list}" var="expStock">
                                <tr>
                                    <td> ${expStock.expDict.expName}</td>
                                    <td> ${expStock.expDict.expModel}</td>
                                    <td> ${expStock.packageSpec}</td>
                                    <td> ${fns:getDictLabel(expStock.packageUnits,'SPEC_UNIT','')}</td>
                                    <td> ${his_fns:getExpSupplierById(expStock.expInfo.expSupplierCata.id)}</td>
                                    <td id="batchNo1"> ${expStock.batchNo}</td>
                                    <td id="expireDate1"> <fmt:formatDate value="${expStock.expireDate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
                                    <td> ${fns:getDictLabel(expStock.sterilizationMethod,"STERILIZATION_METHOD","")}</td>
                                    <td> ${expStock.sterilizationBatchNo}</td>
                                    <td> <fmt:formatDate value="${expStock.sterilizationDate}" pattern="yyyy-MM-dd HH:mm:ss"/> </td>
                                    <td> ${expStock.quantity/expStock.packageNum}</td>
                                </tr>
                            </c:forEach>
                        </table>
                        <div class="pagination">${page}</div>
                    </div>
                </div>
            </section>
        </div>
    </div>